<td>
<?=getObjByKey("portal_objects","name","id",$currentObject->parentid)?>
</td>

<td><?php 
				
$sSql= "Select Count(parentId) as cnt From portal_menu where parentId = ".$currentObject->id;
	if (EW_DEBUG_ENABLED) echo $sSql."<br/>";
	$rs2=$GLOBALS["conn"]->Execute($sSql);
	$cnt=$rs2->fields["cnt"];
	if ($cnt>0){
				?>
<a href="<?php echo ew_ScriptName(); ?>?parentId=<?php echo $currentObject->id; ?>"><img src="images/subpages.png" border="0" title="Sub pages" alt="subpages" ></a>
<?php } ?>
</td>